{extend name="layout/common_layout" /}
{block name="body"}
    <!--tab标签-->
    <div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class=""><a href="{:url('admin/goods/index')}">后序管理</a></li>
            <li class="layui-this">添加后序</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" action="{:url('admin/goods/save')}" method="post">
                    <div class="layui-form-item">
                        <label class="layui-form-label">所属分类</label>
                        <div class="layui-input-block cids">
                            <select name="fid"  id="cid" lay-verify="required">
                                <option>请选择</option>
                                {foreach name="getFloor" item="vo"}
                                <option value="{$vo.id}">{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">类型</label>
                        <div class="layui-input-block">
                            <select name="type" lay-verify="required">
                                <option>请选择</option>
                                <option value="1">后道工序</option>
                                <option value="2">装订方式</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="name" value="" required  lay-verify="required" placeholder="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">计算类型</label>
                        <div class="layui-input-block">
                            <select name="calculationtype" lay-verify="required">
                                <option>请选择</option>
                                <option value="1">P</option>
                                <option value="2">㎡</option>
                                <option value="3">本</option>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">单价</label>
                        <div class="layui-input-block">
                            <input type="text" name="unitprice" value="" required  lay-verify="required" placeholder="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">最低价</label>
                        <div class="layui-input-block">
                            <input type="text" name="minprice" value=""  placeholder="" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{/block}
{block name="js"}
<!--<script src="__JS__/kindeditor/kindeditor.config.js"></script>-->
<!--<script src="__JS__/layui/layui.js"></script>-->
<script src="__JS__/ueditor/ueditor.config.js"></script>
<!--<script src="__JS__/ueditor/ueditor.all.min.js"></script>-->
{/block}
{block name="script"}
<script>
//        $('.cids').on('click','dd',function(){
////            alert($(this).attr('lay-value'));
//            var res = $(this).attr('lay-value');
//            if (res == 1){
//                    //画册显示
//                $("#picturealbum").css('display', 'block');
//                $("#reticule").css('display', 'none');
//
//            } else if (res == 3){
//                    //手提袋显示
//                $("#reticule").css('display', 'block');
//                $("#picturealbum").css('display', 'none');
//
//            } else {
//                $("#picturealbum").css('display', 'none');
//                $("#reticule").css('display', 'none');
//                alert('该分类下没有系统参数配置');
//            }
//
//        })
//    $('.cids').on('click','dd',function(){
////        alert($(this).attr('lay-value'));
//        var fid = $(this).attr('lay-value');
//        var url = "{:url('type/getTypeinfo')}";
//            $.ajax({
//                url: url,
//                data:{
//                    'fid' : fid
//                },
//                type: 'post',
//                dataType:'JSON',
//                success: function (data) {
//                    var html_str = '';
//                    if (data.code == 1) {
//                        $.each(data['data'], function (idx, data) {
//                            html_str +=  '<dd lay-value="'+data.id+'" onclick="gettypename('+data.id+',\''+data.name+'\')">'+data.name+'</dd>'
//                        })
//                    }else {
//                        html_str = '';
//                    }
//                    $('#tid').siblings('div').find('dl').html(html_str);
//
//                }, error: function () {
//                    mui.alert("网络异常");
//                }
//            })
//    })
//    //点击种类
//    function gettypename(tid, name)
//    {
//        $('#tid').find('option').val(tid);
//        $('#tid').siblings('div').find('input').val(name);
//    }


</script>
{/block}